package com.lxmes.business.mapper;

import java.util.List;
import com.lxmes.business.domain.CcPurchaseInfo;
import com.lxmes.common.annotation.DataScope;
import org.apache.ibatis.annotations.Param;

/**
 * 采购单Mapper接口
 * 
 * @author 张志煜
 * @date 2022-11-27
 */
public interface CcPurchaseInfoMapper 
{
    /**
     * 查询采购单
     * 
     * @param id 采购单主键
     * @return 采购单
     */
    public CcPurchaseInfo selectCcPurchaseInfoById(Long id);

    /**
     * 查询采购单列表
     * 
     * @param ccPurchaseInfo 采购单
     * @return 采购单集合
     */
    @DataScope(deptAlias = "de", userAlias = "de")
    public List<CcPurchaseInfo> selectCcPurchaseInfoList(CcPurchaseInfo ccPurchaseInfo);
    /*查询采购单的物料里是否有同一个供应商*/
    @DataScope(deptAlias = "de", userAlias = "de")
    public List<CcPurchaseInfo> selectCcPurchaseInfoListBydanhaoAndSupplyId(CcPurchaseInfo ccPurchaseInfo);
    /*采购物料入库选择数据*/
    @DataScope(deptAlias = "de", userAlias = "de")
    public List<CcPurchaseInfo> selectCcPurchaseInfoSelectList(CcPurchaseInfo ccPurchaseInfo);
    @DataScope(deptAlias = "de", userAlias = "de")
    public List<CcPurchaseInfo> selectCcPurchaseInfoApplyList(CcPurchaseInfo ccPurchaseInfo);
    /*根据多个id查询采购物料*/
    public List<CcPurchaseInfo> selectCcPurchaseInfoListByIds(Long [] ids);

    /**
     * 新增采购单
     * 
     * @param ccPurchaseInfo 采购单
     * @return 结果
     */
    public int insertCcPurchaseInfo(CcPurchaseInfo ccPurchaseInfo);

    /**
     * 修改采购单
     * 
     * @param ccPurchaseInfo 采购单
     * @return 结果
     */
    public int updateCcPurchaseInfo(CcPurchaseInfo ccPurchaseInfo);

    /**
     * 删除采购单
     * 
     * @param id 采购单主键
     * @return 结果
     */
    public int deleteCcPurchaseInfoById(Long id);

    /**
     * 批量删除采购单
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteCcPurchaseInfoByIds(Long[] ids);

    //获取今天的code编码
    public String getNewCode(String newDate);
    //获取今天的一个采购单和供应商合同code编码
    public String getHtNewCode(String newDate);
}
